package com.car.loan.project.xr.util.vo.modify;

import com.car.loan.project.xr.domain.CustomerGuarantor;
import com.car.loan.project.xr.domain.CustomerSpouse;
import com.car.loan.project.xr.domain.LoanAlbum;
import com.car.loan.project.xr.domain.LoanContact;
import com.car.loan.project.xr.util.bo.business.LoanAlbumBo;
import com.car.loan.project.xr.util.bo.business.modify.LoanModifyInfoBo;
import com.car.loan.project.xr.util.bo.business.modify.ModifyIgnore;
import com.car.loan.project.xr.util.vo.LoanAlbumVo;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Map;
import lombok.Data;

/**
 * @author huangding
 * @date 2020/2/20 20:46
 */
@Data
public class LoanModifyDetail {


    @ApiModelProperty("基本信息")
    private BaseInfo baseInfo;

    @ApiModelProperty("借款人信息")
    private CustomerInfo customerInfo;

    @ApiModelProperty("配偶信息")
    private CustomerSpouse customerSpouse;

    @ApiModelProperty("担保人信息")
    private List<CustomerGuarantor> customerGuarantorInfos = Lists.newArrayList();

    @ApiModelProperty("联系人信息")
    private List<LoanContact> customerContactInfos;

    @ApiModelProperty("业务信息")
    private BusinessInfo businessInfo;

    @ApiModelProperty("还款信息")
    private RepayInfo repayInfo;

    @ApiModelProperty("修改记录")
    private List<LoanModifyInfoBo> loanModifyInfos = Lists.newArrayList();

    @ApiModelProperty("附件信息,map类型，key等于附件类型")
    private Map<Integer, List<LoanAlbumVo>> loanAlbumMap;

    @Data
    @ApiModel("还款信息")
    public static class RepayInfo {

        /**
         * 还款卡号
         */
        @ApiModelProperty("还款卡号")
        private String repayCardNo;

        /**
         * 扣款卡号
         */
        @ApiModelProperty("扣款卡号")
        private String deductionCardNo;

    }


    @Data
    public static class BusinessInfo {

        @ApiModelProperty("银行名称")
        private String bankName;

        @ApiModelProperty("银行id")
        private Long bankId;

        @ApiModelProperty("银行方案id")
        private Long bankSchemeId;

        @ApiModelProperty("银行方案类型id")
        private Long bankTypeId;


        @ApiModelProperty("车辆类型")
        private String carType;

        @ApiModelProperty("车辆性质")
        private Integer carNature;

        @ApiModelProperty("分期金额")
        private Double installmentAmount;

        @ApiModelProperty("期数")
        private Long term;

        @ApiModelProperty("银行费率")
        private Double bankRate;

        @ApiModelProperty("执行费率")
        private Double rate;

        @ApiModelProperty("融资金额")
        private Double financingAmount;

        @ModifyIgnore
        public Long getBankId() {
            return bankId;
        }

        @ModifyIgnore
        public Long getBankSchemeId() {
            return bankSchemeId;
        }

        @ModifyIgnore
        public Long getBankTypeId() {
            return bankTypeId;
        }

        @ModifyIgnore
        public Double getRate() {
            return rate;
        }

    }

    @Data
    @ApiModel("基本信息")
    public static class BaseInfo {

        @ApiModelProperty("业务编号")
        private String businessNo;

        @ApiModelProperty(value = "部门id", required = true)
        private Long deptId;

        @ApiModelProperty(value = "部门", required = true)
        private String deptName;

        @ApiModelProperty(value = "业务员id", required = true)
        private Long adminId;

        @ApiModelProperty(value = "业务员", required = true)
        private String adminName;

        @ApiModelProperty(value = "合作商户id")
        private Long dealerId;

        @ApiModelProperty(value = "合作商户")
        private String dealerName;

        @ModifyIgnore
        public String getBusinessNo() {
            return businessNo;
        }

        @ModifyIgnore
        public Long getDeptId() {
            return deptId;
        }

        @ModifyIgnore
        public Long getAdminId() {
            return adminId;
        }

        @ModifyIgnore
        public Long getDealerId() {
            return dealerId;
        }
    }


    @ApiModel("借款人信息")
    @Data
    public static class CustomerInfo {

        @ApiModelProperty(value = "客户姓名", required = true)
        private String name;

        @ApiModelProperty(value = "手机号码", required = true)
        private String mobile;

        @ApiModelProperty(value = "0=身份证 ", required = true)
        private Integer idType;

        @ApiModelProperty(value = "客户证件号码", required = true)
        private String idCardNo;


        @ApiModelProperty("职务")
        private String duty;

        @ApiModelProperty("婚姻状况")
        private Integer marry;

        @ModifyIgnore
        public Integer getMarry() {
            return marry;
        }

        @ApiModelProperty("居住省")
        private String province;

        @ApiModelProperty("居住市")
        private String city;

        @ApiModelProperty("居住区")
        private String area;

        @ApiModelProperty("居住地址")
        private String address;

        @ApiModelProperty("通讯省")
        private String messageProvince;

        @ApiModelProperty("通讯市")
        private String messageCity;

        @ApiModelProperty("通讯区")
        private String messageArea;

        @ApiModelProperty("通信地址")
        private String messageAddress;

        @ApiModelProperty("工作单位")
        private String workUnit;

        @ApiModelProperty("单位电话")
        private String unitTel;

        @ApiModelProperty("单位省")
        private String unitProvince;

        @ApiModelProperty("单位市")
        private String unitCity;

        @ApiModelProperty("单位区")
        private String unitArea;

        @ApiModelProperty("单位地址")
        private String unitAddress;
    }

}
